﻿@model _1061102_1061114_1061129_1061132_1061141.Models.SanPham

@{
    ViewBag.Title = "ThemSanPham";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Them San Pham</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

<form action="@Url.Content("~/QuanLiSanPham/ThemSanPham")" enctype="multipart/form-data" method="post">
    <fieldset>
        <legend>Sản Phẩm</legend>

        <div class="editor-label">
            Loại sản phẩm:
        </div>
        <div class="editor-field">
            @Html.DropDownList("ma", new SelectList(ViewBag.LoaiSP as System.Collections.IEnumerable, "ma", "tenLoai"), new { style = "width: 255px;" })
        </div>

        <div class="editor-label">
            Tên sản phẩm:
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.ten)
            @Html.ValidationMessageFor(model => model.ten)
        </div>

        <div class="editor-label">
            Đơn giá:
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.dongia)
            @Html.ValidationMessageFor(model => model.dongia)
        </div>

        <div class="editor-label">
            Mô tả tóm tắt:
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.motatomtat)
            @Html.ValidationMessageFor(model => model.motatomtat)
        </div>

        <div class="editor-label">
            Mô tả chi tiết:
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.motachitiet)
            @Html.ValidationMessageFor(model => model.motachitiet)
        </div>

        <div class="editor-label">
            Trạng thái:
        </div>
        <div class="editor-field">
            @Html.CheckBoxFor(model => model.trangthai)
        </div>

        <div class="editor-label">
            Hình
        </div>
        <div class="editor-field">
            <input type="file" name="file2" id="fileView" style="width: 250px;" />
        </div>

        <p>
            <input type="submit" value="Thêm" />
        </p>
    </fieldset>
</form>

<div>
    @Html.ActionLink("Trở lại", "Index")
</div>
